gusucode.com > 耐品图片管理系统 标准版A > 耐品图片管理系统 标准版A/Admin_Images.asp

    <!--#include file="Admin_ChkPurview1.asp"-->
<!--#include file="Inc/UpdateData.asp"-->
<%
'===============================================================
' 著作权号:中国国家版权局著作权登记号2004SR07385
' 版权所有:深圳市耐品科技开发有限公司 www.naipin.com
' 联系电话:0755-26611119 81234844 81234845
' 联系手机:13316911914
' 联系邮箱:naipin@naipin.com
'===============================================================

If Netout.GetCookie("Self")="0" then
	Behind.WriteErrMsg("<br><li>对不起,您没有管理图片的权限!</li>")
	Response.End()
End If
Dim ClassID,TheField,Keywords,Sql,TitleId,ImageId
ClassID = Netout.CheckNumeric(Request("ClassID"))
TheField = Netout.CheckStr(request("TheField"),"")
Keywords = Netout.CheckStr(Trim(Request("keyword")),"")
SpecialId = Netout.CheckNumeric(Request("SpecialID"))
TitleId = Netout.CheckNumeric(Request.QueryString("TitleId"))

Sql="select a.titleID,a.ClassID,a.titleName,a.iClick,a.ManuName,b.Recomm,b.IsHide,a.UpdateTime,b.ID,b.ImageFile,b.FileExt from NT_title as a,NT_imgbook as b where b.titleID=a.titleID and a.iCount<>0 and b.Passed=1"
if ClassID>0 then Sql = Sql & " and a.ClassID="&ClassID
If ImageId>0 Then Sql = Sql & " and b.Id="&ImageId
If SpecialId>0 Then Sql = Sql & " and a.SpecialId="&SpecialId
If TitleId>0 Then Sql = Sql & " and a.TitleId="&TitleId

select case TheField
case "Title"
	if Keywords<>"" then sql=sql&" and a.titleName like '%"&Keywords&"%'"
case "ManuName"
	if Keywords<>"" then sql=sql&" and a.ManuName like '%"&Keywords&"%'"
case else
	if Keywords<>"" then sql=sql&" and (a.titleName like '%"&Keywords&"%' Or a.titleDesc like '%"&Keywords&"%')"
end select

if Not Netout.Master and Netout.GetCookie("Manage")="0" and Netout.GetCookie("Self")="1" then
	sql=sql&" and a.titleUser='"&Netout.UserName&"'"
end if
sql=sql&" order by a.AddTime desc,b.ID desc"

%>
<html>
<head>
<title>无标题文档</title>
<SCRIPT language=javascript>
function unselectall(){
    if(document.myform.chkAll.checked){
		document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function CheckAll(form){
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if (e.Name != "")
		e.checked = form.chkAll.checked;
	}
}
function ConfirmDel(){
	if(document.myform.Action.value=="Del"){
		document.myform.action="Admin_ImagesDel.asp";
		if(confirm("确定要删除选中的图片吗?本操作是无法恢复的!"))
		    return true;
		else
			return false;
	}else{
		document.myform.action="Admin_ImagesDel.asp";
		if(confirm("确定要移动选中的图片吗?"))
		    return true;
		else
			return false;
	}
}

</SCRIPT>
<script language="javascript" src="Inc/Pop.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
Dim rs,str,strFile,CurrentPage

Title="管 理 上 传 图 片"
IF Netout.Master Then
	Link="<a href='Admin_Add.asp?TypeID=1' class='black'>添加图片</a> | <a href='Admin_User.asp' class='black'>管理用户</a> | <a href='Admin_Class.asp' class='black'>管理分类</a> | <a href='Admin_SiteConfig.asp' class='black'>系统配置</a>"
Else
	Link="<a href='Admin_Add.asp?TypeID=1' class='black'>添加图片</a>"
End IF

str="Admin_Images.asp?h=n&ImageId="&ImageId&"&SpecialID="&SpecialId
if ClassID = 0 then
	if keywords<>"" then str=str&"keyword="&keywords
else
	if keywords="" then
		str=str&"ClassID="&ClassID
	else
		str=str&"ClassID="&ClassID&"&keyword="&keywords
	end if
end if
if right(str,1)<>"&" then str=str&"&"
if Field<>"" then str=str&"Field="&Field

strFile = str
CurrentPage = Netout.CheckStr(request.QueryString("page"),1)

With Behind
	.WriteHtmlHead
	.WriteHtmlTop Title,Link
	.MaxPerPage	 = 15
	.TopPage	 = False
	.BottomPage	 = True
	.SqlRecord	 = sql
	.InitText	 = "张图片"
	.strFileName = strFile
	.ShowRecord CurrentPage
	.ShowSearchForm(strFile)
	.WriteHtmlEnd
End With
set Netout=nothing

Sub ShowContent(MaxPerPage)
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form name="myform" method="Post" action="Admin_ImagesDel.asp?page=<%=CurrentPage%>" onSubmit="return ConfirmDel();">
    <tr> 
      <td colspan="2"><table width="100%" border="0" cellspacing="1" cellpadding="2" class="border">
          <tr align="center"> 
            <td class="tdbg1" width="6%">选中</td>
            <td class="tdbg1">所属组图</td>
            <td width="90" class="tdbg1">所属分类</td>
            <td class="tdbg1" width="45">点击数</td>
            <td class="tdbg1" width="70">上传日期</td>
            <td class="tdbg1" width="120">操作</td>
          </tr>
		<%
		i=0
		set ImageId = rs("ID")
		set titleID=rs("titleID")
		set iClick=rs("iClick")
		Set ImageFile = rs("ImageFile")
		set titleName=rs("titleName")
		set ManuName=rs("ManuName")
		Do While Not rs.Eof and i<MaxPerPage
			if Config.WaterMark(0) = "1" then
				PicUrl=Config.ImagePath(2)&ImageFile
			else
				PicUrl=Config.ImagePath(0)&Replace(ImageFile,".jpg","."&Rs("FileExt"))
			end if
		%>
          <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#EBEBEB'"> 
            <td align="center"><input name='ImageId' type='checkbox' onClick="unselectall()" id="ImageId" value='<%=ImageId%>'></td>
            <td title="<img src=<%=PicUrl%> width=100>" style="cursor: hand; padding-left: 5px;">
				<a href="?keyword=<%=titleName%>" class="black" title="<img src=<%=PicUrl%> width=100>"><%=Netout.CutStr(titleName,50)%></a></td>
            <td><a href="?ClassId=<%=Rs("ClassId")%>"><%=Conn.Execute("Select ClassName from Nt_ClassName where Id="&Rs("ClassId"))(0)%></a></td>
            <td align="center"><%=iClick%></td>
            <td align="center"><%=formatdatetime(rs("updatetime"),2)%></td>
            <td align="center">
				<%
				Recomm = rs("Recomm")
				if Netout.Master then
					With Response
						if Recomm then
							.Write "<font color='#FF0000'>推荐</font>"
						Else
							.Write "<a href=""Admin_ImagesDel.asp?ImageId="&ImageId&"&Action=Recomm&vAction=1"" class='black'>推荐</a>"
						End If
					End With
				End If
				IsHide = Rs("IsHide")
				If IsHide Then
					Response.Write(" <font color='#FF0000'>隐藏</font> ")
				Else
				%>
            	<a href="Admin_ImagesDel.asp?Action=Hide&vAction=1&ImageId=<%=ImageId%>" class="black">隐藏</a>
				<%
				End If
				%>
				<a href="Admin_ImagesModify.asp?ImageId=<%=ImageId%>" class="black">修改</a> 
				<a href="Admin_ImagesDel.asp?Action=Del&ImageId=<%=ImageId%>" class="black" onclick='return ConfirmDel();'>删除</a>            </td>
          </tr>
		<%
			i=i+1
			rs.MoveNext
		loop
		%>
        </table>
      <br></td>
    </tr>
    <tr> 
      <td width="34%" height="20">&nbsp;&nbsp;
	  	<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
        选中本页所有图片</td>
      <td width="66%">
	  	<input name="submit" type='submit' value='删除选定的图片' style="width: 110px;" onClick="document.myform.Action.value='Del'">
        <input name="Action" type="hidden" id="Action" value="Del">
        &nbsp;&nbsp;&nbsp;&nbsp; </td>
    </tr>
  </form>
</table>
<%
End Sub
%>